<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CartPostRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     * 添加购物车验证
     */
    public function rules()
    {
        return [
            //
            'goods_id' => 'required',
            'number' => 'required',
            'spec_goods_id' => 'required'
        ];
    }

//    public function messages()
//    {
//        return[
//            'goods_id.required' => '请选择商品',
//            'number.required' => '请输入你要够买的数量',
//            'spec_goods_id.required' => '请选择属性'
//        ];
//    }

}
